/**
 * @license
 * Copyright 2024 The Model Explorer Authors. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ==============================================================================
 */

.container {
  font-size: 12px;
  display: flex;
  align-items: center;
  line-height: 14px;
  position: relative;
  color: var(--me-on-surface-color);

  .collection-label {
    font-weight: 700;
    margin-right: 6px;
  }

  .select-form {
    height: 0;
    max-height: 0;
    position: absolute;
    top: 26px;
    right: 28px;

    ::ng-deep > * {
      height: 0;
    }
  }

  .selector-label-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-grow: 1;
  }

  .option-label {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    margin-right: 2px;
  }

  .node-count-label {
    color: var(--me-on-surface-low-color);
    margin-left: 12px;
  }

  .triangle {
    font-size: 10px;
    margin-left: 8px;
  }

  .graph-selector-label {
    font-size: 12px;
    border: 1px solid var(--me-outline-variant-color);
    border-radius: 3px;
    padding: 2px 4px;
    cursor: pointer;
    flex-grow: 1;
    height: 24px;
    display: flex;
    box-sizing: border-box;

    .selector-label-container {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-grow: 1;
    }

    &:hover {
      border-color: var(--me-primary-color);
    }
  }

  .mat-icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
    cursor: pointer;
    color: var(--me-on-surface-variant-color);

    &:hover {
      color: var(--me-on-surface-color);
    }
  }
}

::ng-deep .graph-selector-panel {
  color: var(--me-on-surface-color);
  background-color: var(--me-surface-container-low-color);

  mat-option {
    height: 24px;
    font-size: 12px;
    min-height: unset;
    padding: 1px 0;
    /* stylelint-disable-next-line declaration-no-important -- override MDC */
    padding-left: 20px !important;
    /* stylelint-disable-next-line declaration-no-important -- override MDC */
    background-color: none !important;

    .option-wrapper {
      display: flex;
      align-items: center;
    }

    .option-container {
      display: flex;
      align-items: center;
      justify-content: space-between;
      letter-spacing: normal;
      font-family: 'Google Sans Text', Arial, Helvetica, sans-serif;
      flex-grow: 1;

      .option-label {
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        /* stylelint-disable-next-line declaration-no-important -- override MDC */
        color: var(--me-on-surface-color) !important;
      }

      .node-count-label {
        color: var(--me-on-surface-low-color);
      }
    }

    .action-button {
      flex-shrink: 0;
      width: 16px;
      height: 16px;
      display: flex;
      align-items: center;
      margin-left: 4px;
      opacity: 0.8;
      cursor: pointer;

      &:hover {
        opacity: 1;
      }

      .block-container {
        border-radius: 3px;
        border: 1px solid var(--me-outline-variant-color);
        height: 100%;
        width: 100%;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        padding: 1px;

        .right-block {
          height: 100%;
          width: 50%;
          background-color: var(--me-surface-container-low-color);
          border-top-right-radius: 2px;
          border-bottom-right-radius: 2px;
        }
      }
    }

    span {
      /* stylelint-disable-next-line declaration-no-important -- override MDC */
      white-space: break-spaces !important;
      word-break: break-all;
      /* stylelint-disable-next-line declaration-no-important -- override MDC */
      line-height: 14px !important;
      width: 100%;
      box-sizing: border-box;
      padding-right: 10px;
    }

    mat-pseudo-checkbox {
      display: none;
    }
  }

  mat-optgroup {
    span {
      min-height: unset;
      font-size: 12px;
      font-weight: 700;
      padding-left: 8px;
    }

    &.graph-search-optgroup {
      pointer-events: none;

      span {
        padding: 0;
      }

      mat-option {
        /* stylelint-disable-next-line declaration-no-important -- override MDC */
        padding-left: 16px !important;
        /* stylelint-disable-next-line declaration-no-important -- override MDC */
        padding-right: 12px !important;
        height: 28px;
      }

      input {
        font-size: 12px;
        width: 100%;
        box-sizing: border-box;
        pointer-events: all;
        border: 1px solid var(--me-outline-variant-color);
        height: 20px;
        border-radius: 4px;
        padding: 0 2px;
      }
    }
  }
}
